package com.dzm.handler;

import com.dzm.except.BusinessException;
import com.dzm.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 作者：Dzm
 * 时间：2024-08-14-10:17
 * 功能：
 */

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(BusinessException.class)
    public R handlerBusinessException(BusinessException e) {
        e.printStackTrace();

        return R.error(e);
    }
}
